<template>
  <div>
    <!-- <div class="info">
      <div class="tip-img">
        <img src="~@img/resources/icon-warning.png" alt="" />
        <p>重点通知</p>
      </div>
      <ul class="tips-list">
        <li>
          2022年4月，园区载体数据未按时在每月15号前提报，迟到5天；负责人李 X
          X，所属部门：市统计局；
        </li>
        <li>
          2022年4月，园区载体数据未按时在每月15号前提报，迟到5天；负责人李 X
          X，所属部门：市统计局；
        </li>
        <li>
          2022年4月，园区载体数据未按时在每月15号前提报，迟到5天；负责人李 X
          X，所属部门：市统计局；
        </li>
        <li>
          2022年4月，园区载体数据未按时在每月15号前提报，迟到5天；负责人李 X
          X，所属部门：市统计局；
        </li>
        <li>
          2022年4月，园区载体数据未按时在每月15号前提报，迟到5天；负责人李 X
          X，所属部门：市统计局；
        </li>
      </ul>
    </div> -->
    <ul class="option">
      <li class="title">
        <img src="~@img/resources/icon-record.png" alt="" />
        <span>日志记录</span>
      </li>
      <li>
        <label for="">选择年月</label>
        <el-date-picker
          v-model="filter_time"
          type="month"
          placeholder="选择年月"
          value-format="yyyy-MM"
          @change="changeTime"
        >
        </el-date-picker>
      </li>
    </ul>

    <div>
      <el-table
        :data="listInfo"
        border
        stripe
        tooltip-effect="light"
        :height="542"
        style="width: 100%;"
        :header-cell-style="{
          textAlign: 'center',
        }"
        :cell-style="{
          textAlign: 'center',
        }"
      >
        <el-table-column
          :show-overflow-tooltip="true"
          prop="people"
          label="操作者"
        >
        </el-table-column>
        <el-table-column
          :show-overflow-tooltip="true"
          prop="mobile"
          label="操作者账号"
        >
        </el-table-column>
        <el-table-column
          :show-overflow-tooltip="true"
          prop="section"
          label="所属部门"
        >
        </el-table-column>
        <el-table-column
          :show-overflow-tooltip="true"
          prop="time"
          label="操作时间"
        >
        </el-table-column>
        <el-table-column
          :show-overflow-tooltip="true"
          prop="message"
          label="操作记录"
          width="400"
        >
        </el-table-column>
        <el-table-column
          :show-overflow-tooltip="true"
          prop="remark"
          label="备注(每月25号前提报)"
        >
        </el-table-column>
      </el-table>
      <div class="pagination">
        <el-pagination
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :current-page.sync="page"
          :page-size="per_page"
          layout=" prev, pager, next,  jumper"
          :total="total"
        >
        </el-pagination>
      </div>
    </div>
  </div>
</template>

<script>
import { ShowLog } from "@api/resources";
export default {
  data() {
    return {
      listInfo: [],
      year: "",
      page: 0,
      per_page: 10,
      total: 0,
      filter_time: "",
    };
  },
  props: ["change"],
  watch: {
    change(newValue, oldValue) {
      if ((newValue = oldValue + 1)) {
        this.ShowLog();
      }
    },
  },
  mounted() {
    this.token = localStorage.getItem("login");
    this.ShowLog();
  },
  methods: {
    async ShowLog() {
      let res = await ShowLog({
        token: this.token,
        page: this.page,
        per_page: this.per_page,
        filter_time: this.filter_time,
        pop_flag: false,
      });
      if (res.code == 0) {
        this.listInfo = res.data;
        this.total = res.size;
      } else {
        this.$message.error(res.msg);
      }
    },
    changeTime() {
      if (this.filter_time == null) {
        this.filter_time = "";
      }
      this.page = 1;
      this.ShowLog();
    },
    handleSizeChange(val) {
      this.per_page = val;
      this.page = 1;
      this.ShowLog();
    },
    handleCurrentChange(val) {
      this.page = val;
      this.ShowLog();
    },
  },
};
</script>

<style lang="less" scoped>
/deep/ .el-table__body-wrapper {
  height: calc(100% - 48px) !important;
}
/deep/ .el-table__body {
  width: 100% !important;
}
.info {
  display: flex;
  height: 172px;
  width: 100%;
  background: #ffffff;
  box-shadow: 0px 0px 9px 0px rgba(189, 189, 189, 0.67);
  border-radius: 6px;
  margin-bottom: 30px;
}
.tip-img {
  flex: 0 0 173px;
  padding-top: 50px;
  background: #faf3f3;
  border-radius: 10px 0px 0px 10px;
  position: relative;
  &::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 172px;
    background: #ff7272;
    border-radius: 6px 0px 0px 6px;
  }
}
.tips-list {
  flex: 1;
  height: 172px;
  padding: 24px 0 24px 100px;
  overflow-y: scroll;
  text-align: left;
  li {
    position: relative;
    padding-left: 30px;
    height: 16px;
    font-size: 16px;
    font-family: Microsoft YaHei;
    font-weight: 400;
    margin-bottom: 20px;
    cursor: default;
    &::after {
      content: "";
      position: absolute;
      top: 10px;
      left: 0;
      width: 10px;
      height: 10px;
      background: #cccccc;
      border-radius: 50%;
    }
    &:hover {
      font-weight: bold;
      color: #dc3e3e;
    }
    &:hover::after {
      background: #dc3e3e;
    }
  }

  scrollbar-color: #ff7272; //滚动条轨道颜色   滚动条滑块的颜色
  scrollbar-width: 12px;
  scrollbar-width: thin; //thin模式下滚动条两端的三角按钮会消失
  &::-webkit-scrollbar {
    /*滚动条整体样式*/
    width: 12px; /*高宽分别对应横竖滚动条的尺寸*/
    height: 12px;
  }
  &::-webkit-scrollbar-thumb {
    /*滚动条里面小方块*/
    border-radius: 12px;
    background: linear-gradient(0deg, #ff7272);
  }
  &::-webkit-scrollbar-track {
    /*滚动条里面轨道*/
    background: rgba(255, 114, 114, 0.1);
    border-radius: 6px;
  }
}
.title img {
  width: 17px;
  height: 19px;
  margin-right: 11px;
}
.title span {
  line-height: 18px;
  font-size: 18px;
  font-family: Microsoft YaHei;
  font-weight: bold;
  color: #333333;
}
/deep/
  .el-table--striped
  .el-table__body
  tr.el-table__row--striped.el-table__row--striped.el-table__row--striped
  td {
  background: #f7faff;
}
.portrait_body {
  width: 100%;
  background: #fafafa;
  height: 100%;
}
.portrait_main {
  margin: 0 auto;
  width: 100%;
  //width: 1500px;
  height: 100%;
  // background: #fff;
}
/deep/ .el-tabs__nav-wrap {
  background: #ffffff;
}

.option {
  display: flex;
  // flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  li {
    flex: 0 0 18%;
    display: flex;
    justify-content: start;
    font-size: 16px;
    font-family: Microsoft YaHei;
    font-weight: 400;
    color: #333333;
    margin-bottom: 20px;
    label {
      width: 120px;
      line-height: 32px;
      margin-right: 10px;
    }
    &.title {
      flex: 0 0 150px;
    }
    &:last-of-type {
      justify-content: start;
    }
  }
}
/deep/ .el-pagination .btn-next,
/deep/ .el-pagination .btn-prev {
  background-color: transparent;
}
/deep/ .el-pagination .btn-next i,
/deep/ .el-pagination .btn-prev i {
  background: #fafafa;
  box-shadow: 0px 0px 4px 0px rgba(86, 86, 86, 0.11);
  border-radius: 6px;
}
/deep/ .el-table--border th {
  border-right: none;
  background: #446db3 !important;
  color: #fff;
}
.add {
  float: left;
  margin: 0 30px 30px 0;
  width: 120px;
  height: 38px;
  line-height: 38px;
  text-align: center;
  font-size: 16px;
  font-family: Microsoft YaHei;
  font-weight: 400;
  color: #ffffff;
  background: #f89718;
  border-radius: 4px;
  cursor: pointer;
}
.del {
  background: #f15847;
  float: right;
}
.flex-from-last .title {
  text-align: left;
  font-weight: bold;
  color: #333;
  font-size: 16px;
  padding: 20px 10px;
}

// 表格分页样式修改
.el-pagination {
  text-align: right;
  margin-top: 20px;
}
/deep/ .el-pager li {
  width: 30px;
  height: 30px;
  line-height: 30px;
  font-size: 16px;
  font-family: Microsoft YaHei;
  font-weight: 400;
  color: #666666;
  background: #fafafa;
  box-shadow: 0px 0px 4px 0px rgba(86, 86, 86, 0.11);
  border-radius: 6px;
  margin: 0 8px;
}

/deep/ .el-pager li.active {
  color: #fff;
  background: #446db3;
  box-shadow: 0px 0px 3px 0px rgba(0, 50, 89, 0.4);
  border-radius: 6px;
}

/deep/ .el-pagination .el-icon-arrow-right:before {
  content: "";
  display: inline-block;
  width: 30px;
  height: 30px;
  background: url("~@img/atlas/icon-page-right.png") no-repeat center;
}
/deep/
  .el-pagination
  button:disabled.btn-next:hover
  .el-icon-arrow-right:before {
  content: "";
  display: inline-block;
  width: 30px;
  height: 30px;
  background: url("~@img/atlas/icon-page-right.png") no-repeat center;
}
/deep/.el-pagination .btn-next:hover .el-icon-arrow-right:before {
  background: url("~@img/atlas/sidenav-hover2.png") no-repeat center;
}
/deep/ .el-pagination .el-icon-arrow-left:before {
  content: "";
  display: inline-block;
  width: 30px;
  height: 30px;
  background: url("~@img/atlas/icon-page-left.png") no-repeat center;
}
/deep/
  .el-pagination
  button:disabled.btn-prev:hover
  .el-icon-arrow-left:before {
  content: "";
  display: inline-block;
  width: 30px;
  height: 30px;
  background: url("~@img/atlas/icon-page-left.png") no-repeat center;
}
/deep/.el-pagination .btn-prev:hover .el-icon-arrow-left:before {
  background: url("~@img/atlas/sidenav-hover1.png") no-repeat center;
}
/deep/.pagination .el-select .el-input.is-focus .el-input__inner {
  height: 30px;
  border-color: #fafafa;
  background: #fafafa;
  box-shadow: 0px 0px 4px 0px rgba(86, 86, 86, 0.11);
  border-radius: 6px;
}
/deep/.pagination .el-input__inner {
  height: 30px;
  color: #666;
  border-color: #fafafa;
  background: #fafafa;
  box-shadow: 0px 0px 4px 0px rgba(86, 86, 86, 0.11);
  border-radius: 6px;
}
/deep/.pagination .el-pagination__sizes .el-input .el-input__inner:hover {
  height: 30px;
  border-color: #fafafa;
  background: #fafafa;
  box-shadow: 0px 0px 4px 0px rgba(86, 86, 86, 0.11);
  border-radius: 6px;
}
/deep/ .el-pagination__jump {
  height: 30px;
  line-height: 30px;
}
/deep/.pagination .el-pagination__jump .el-input__inner {
  color: #ccc;
}
/deep/.pagination .el-pagination__jump .el-input__inner.active {
  color: #666;
}
/deep/.el-pagination__jump .el-input__inner:focus {
  color: #666;
}

@media screen and (min-width: 1366px) and (max-width: 1600px) {
  .portrait_main {
    width: 100%;
  }

  /deep/ .el-tabs .el-tabs__content {
    width: 100%;
  }
  /deep/ .edit_dialog1 .el-dialog {
    width: 1010px;
    height: 810px;
    margin-left: -505px !important;
    margin-top: -405px !important;
  }
  .flex_dialog .flex-steps {
    flex: 0 0 150px;
    height: 600px;
  }
  .dialog_box .el-input {
    margin-bottom: 14px;
  }
  .el-textarea {
    height: 100px;
  }
  /deep/ .el-step.is-vertical .el-step__line {
    top: 42px;
  }
  /deep/ .el-step__line {
    height: 60px;
  }
  .flex-from-last .title {
    padding: 10px 10px;
  }
}
@media only screen and (width: 1366px) {
  .portrait_main {
    width: 100%;
  }

  /deep/ .el-tabs .el-tabs__content {
    width: 1010px;
  }
}
@media screen and (max-width: 1200px) {
  .portrait_main {
    width: 100%;
  }

  /deep/ .el-tabs .el-tabs__content {
    width: 802px;
    overflow: hidden;
    overflow-y: scroll;
  }
  .add {
    width: 90px;
  }
  /deep/ .edit_dialog1 .el-dialog {
    width: 1010px;
    height: 720px;
    margin-left: -505px !important;
    margin-top: -360px !important;
  }
  /deep/ .el-dialog__header {
    height: 60px;
    line-height: 60px;
  }
  .flex_dialog .flex-steps {
    height: 540px;
  }
  /deep/ .dialog_box .el-input {
    margin-bottom: 10px;
  }
  .el-textarea {
    height: 100px;
  }
  /deep/ .el-step.is-vertical .el-step__line {
    top: 42px;
  }
  /deep/ .el-step__line {
    height: 48px;
  }
  .flex-from-last .title {
    padding: 4px 10px;
  }
}
/deep/ .el-table {
  max-width: 1530px !important;
}
/deep/ .el-table .cell {
  height: 48px;
  line-height: 48px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/deep/ .el-table--border th {
  padding: 0;
}
/*
  *常用电脑尺寸  1680 * 900
  *              1536 * 864
  *              1440 * 900
  *ipad pro      1366 * 1024
  *ipad mini     1024 * 768
  *ipad          1024 * 768
 */
/*分辨率低于1680，采用下面的样式*/
@media screen and (max-device-width: 1680px) {
  /deep/ .el-table {
    max-width: 1290px !important;
  }
}
/*分辨率低于1536，采用下面的样式*/
@media screen and (max-device-width: 1536px) {
  /deep/ .el-table {
    max-width: 1145px !important;
    height: 392px !important;
  }
}
/*分辨率低于1440，采用下面的样式*/
@media screen and (max-device-width: 1440px) {
  /deep/ .el-table {
    max-width: 1066px !important;
    height: 491px !important;
  }
}
/*分辨率低于1366，采用下面的样式*/
@media screen and (max-device-width: 1366px) {
}
/*分辨率低于1180，采用下面的样式*/

@media screen and (max-device-width: 1180px) {
  /deep/div .el-tabs .el-tabs__content {
    width: 940px !important;
  }
  .edit .el-dialog {
    transform: scale(0.8);
    -moz-transform: scale(0.8);
    -webkit-transform: scale(0.8);
    -o-transform: scale(0.8);
  }

  /deep/ .el-table {
    max-width: 890px !important;
    height: 392px !important;
  }
}
/*分辨率低于1024，采用下面的样式*/
@media screen and (max-device-width: 1024px) {
  .edit .el-dialog {
    transform: scale(0.8);
    -moz-transform: scale(0.8);
    -webkit-transform: scale(0.8);
    -o-transform: scale(0.8);
  }

  /deep/ .el-table {
    max-width: 734px !important;
    height: 340px !important;
  }

  .add {
    width: 100px;
  }
  /deep/ .option .el-button {
    width: 120px;
  }
}
/deep/ .el-table .el-table__body-wrapper .el-table__cell .cell,
/deep/ .el-table .el-table__fixed-body-wrapper .el-table__cell .cell {
  cursor: default !important;
}
</style>
